<template>
	<view class="">
		<view class="pt100" v-if="!list.length">
			<u-empty mode="order" />
		</view>
		<view v-for="(item,index) in list" :key="index" @click.stop="jump(item)"
			class="box-shadow mt20 pl20 pr18 pt26 radius20 bg-fff pb24 my_box_shadow">
			<!-- <view v-if="item.order_sn" class="radius20 h76 pl18 pr18 bg-f7f mb20 flex">
				<view class="color-999">订单号：</view>
				<view class="flex1">{{item.order_sn}}</view>
				<view class="color-zs fs26">{{item.status_text||item.status}}</view>
			</view> -->
			<view class="flex row-between pb24 border-b mb20">
				<view class="color-zs fs30 fw-600">{{item.title||item.service_name}}</view>
				<view class="color-666 fs28" v-if="item.type==0">剩余出价<text
						class="color-zs">{{item.offer_surplus}}</text>人</view>
				<view class="color-fs" v-else>{{item.status_text}}</view>
			</view>
			<view class="pb20 mb20 border-b flex" v-if="item.service_type==2">
				<image :src="item.image" class="w96 h96 radius10" mode="aspectFill"></image>
				<view class="flex flex1 row-between ml20 fw-w">
					<view class="">{{item.service_name}} </view>
					<view class="color-fs ">￥{{item.pay_price}}</view>
				</view>
			</view>
			<view class="flex row-between pb24">
				<view class="flex1">
					<view class="pb24 fw-w">{{item.hospital||item.hospital_name}}</view>
					<view class="pb24 flex">
						<image src="/static/img/index/address1.png" class="w26 h26" mode=""></image>
						<view class="ml10 fs26 flex1">{{item.address}}</view>
					</view>
					<view class=" color-666">期望开始时间:{{item.expect_time}}</view>
				</view>
				<view class="flex-col col-center" v-if="item.order_id">
					<u-avatar v-if="item.image" :src="item.image" size="92"></u-avatar>
					<view class="mt10 u-line-1" style="max-width: 180rpx;">{{item.name}}</view>
				</view>
			</view>
			<view class="border-b mb20"></view>
			<view class="flex row-between fs26">
				<view class="" v-if="item.pay_price*1">
					<text class="color-999 fs26">{{item.pay_time?'已':'应'}}付款</text>
					<text class="color-fs fs26">￥</text>
					<text class="fs32 color-fs">{{item.pay_price}}</text>
				</view>
				<view class="" v-else-if="item.distance">
					<text>距离</text>
					<text class="color-zs">{{item.distance}}</text>
				</view>
				<view class=""></view>
				<view class="">
					<block v-if="item.status*1">
						<view class="button_box" v-if="item.status==2">立即签到</view>
						<view class="button_box" v-else-if="item.status==8">审核</view>
						<view class="button_box" v-else-if="item.status==7"
							@click.stop="$u.route('/pages/order/evaluate',{order_id: item.order_id || item.id || ''})">
							查看评价</view>
						<view class="button_box" v-else-if="item.status==4">提交核销</view>
					</block>
					<block v-else-if="item.service_type==0">
						<block v-if="item.type==0">
							<view class="button_box" v-if="item.offer_price*1>0">已出价{{item.offer_price*1}}</view>
							<view class="button_box" v-else-if="item.offer_surplus*1>0">出价接单</view>
						</block>
					</block>
					<block v-else-if="item.service_type==1||item.service_type==2">
						<view class="button_box" v-if="item.type==1">抢单</view>
						<view class="button_box" v-else-if="item.type==2">接单</view>
						<view class="button_box opa7" v-else-if="item.type==3">已被抢走</view>
						<view class="button_box" v-else-if="item.type==4">已接单</view>
					</block>
				</view>
			</view>
			<view class="flex row-between pt20" v-if="myBaojia">
				<view class="">
					<text>我的报价:</text>
					<text class="color-fs">200元</text>
				</view>
				<view v-if="index==0" @click.stop="$u.route('/pages/index/baijia/hireD')"
					class="pl12 pr12 h64 radius12 color-999 flex row-center"
					style="background: #f8f8f8;color: #999;border: 1px solid #e3e3e3;">
					查看详情
				</view>
				<view v-else-if="index==1" class="pl12 pr12 h64 radius12 color-999 flex row-center"
					style="background: #f8f8f8;color: #999;border: 1px solid #e3e3e3;">
					订单报价已结束
				</view>
				<view v-else class="pl12 pr12 h64 radius12 color-999 flex row-center"
					style="background: #f8f8f8;color: #999;border: 1px solid #e3e3e3;">
					很遗憾，订单已雇佣其他师傅
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "orderInfo",
		props: {
			list: {
				default: ''
			},

			order: {
				default: false
			},

			myBaojia: {
				default: false
			},
		},
		data() {
			return {

			};
		},
		methods: {
			jump(item) {
				let params = {
					order_id: item.order_id || item.id || '',
					cancel_id: item.cancel_id || ''
				}
				if (!params.order_id) return
				this.$u.route('/pages/order/orderD', params)
			}
		}
	}
</script>

<style lang="scss">
	.my_box_shadow {
		box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0.07);
	}

	.button_box {
		width: 160rpx;
		height: 64rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 12rpx;
		color: #fff;
		background-color: $zs;
	}
</style>
